﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YouHP.Model;
using YouHP.Atom;

namespace YouHP.Logic
{
    public class EmotionLogic
    {
        PatientEmotion _emotionInst = new PatientEmotion();

        enum EmotionTypeEnum
        {
            Happy = 0,
            Tears = 1,
            Sad = 2,
            Angery = 3,
            Surprise = 4,
            Tired = 5
        }

        public EmotionLogic()
        {
        }   // EmotionLogic

        public EmotionInfo GetEmotion(int userid)
        {
            EmotionInfo emotionInfo =  _emotionInst.GetEmotion(userid);

            int emotionTypeId = emotionInfo.EmotionType;
            emotionInfo.EmotionTypeData = GetEmotionType(emotionTypeId);

            return emotionInfo;
        }   // GetEmotion

        public int AddEmotion(EmotionInfo info)
        {
            return _emotionInst.AddEmotion(info);
        }   // AddEmotion

        public EmotionTypeInfo GetEmotionType(int typeid)
        {
            return _emotionInst.GetEmotionType(typeid);
        }

        public List<EmotionTypeInfo> GetAllEmotionTypes()
        {
            return _emotionInst.GetAllEmotionTypes();
        }
    }
}
